/*
	Filename	:	bjBonus.h
	Author(s)	:	Ray E. Bornert II
	Date		:	2002-MAY-14
	Copyright	:	(c) 2002 RealTimeGaming

	History		:
*/

//////////
// GATE //
//////////
#ifndef _BJBONUS_H_
#define _BJBONUS_H_

/////////////
// FORWARD //
/////////////
class BJBonus;
class ODBCQuery;

//////////////
// INCLUDES //
//////////////
#include "lib.h"
#include "bjhand.h"

/////////////
// DEFINES //
/////////////


////////////
// OBJECT //
////////////
class BJBonus
{
/////////////
// MEMBERS //
/////////////

private://MEMBERS
	char	m_who;			//dealer or player
	char	m_type;			//win or instant
	char	m_name[16];		//name of the bonus
	char	m_pattern[44];	//player card pattern
	char	m_pattern2[44];	//dealer card pattern 
	int		m_minHands;		//min hands to qualify
	int		m_maxHands;		//max hands to qualify
	int		m_minCards;		//min cards to qualify
	int		m_maxCards;
	int		m_minTotal;
	int		m_maxTotal;
	int		m_minNBets;
	int		m_maxNBets;
	int		m_bonusTotal;
	float	m_bonusPayout;

public:	//MEMBERS

/////////////
// METHODS //
/////////////

private://METHODS

	int IsHandQualified( char who, BJHand* pHand, int nHands, unsigned char duc=0 );
	int IsHandPossible ( char who, BJHand* pHand, int nHands, unsigned char duc=0 );
	int IsPattern();
	int IsPattern2();

public:	//METHODS

	BJBonus();
	~BJBonus();

	void SetBonus
	(
		char	who,			//dealer or player
		char	type,			//win or instant
		char*	pName,			//name of the bonus
		char*	pPattern,		//player card pattern
		char*	pPattern2,		//dealer card pattern
		int		minHands,		//min hands to qualify
		int		maxHands,		//max hands to qualify
		int		minCards,		//min cards to qualify
		int		maxCards,		//max cards to qualify
		int		minTotal,		//min total to qualify
		int		maxTotal,		//max total to qualify
		int		minNBets,		//min number of bets ( has doubled? )
		int		maxNBets,		//max number of bets  
		int		bonusTotal,		//bonus added to hand score
		float	bonusPayout		//bonus payout in terms of the original bet
	);

	//get
	char	GetWho();
	char	GetType();
	char*	GetName();
	int		GetBonusTotal();
	float	GetBonusPayout();

	int		IsDealerHandQualified( BJHand* pDealer, int nHands );
	int		IsPlayerHandQualified( BJHand* pPlayer, int nHands, unsigned char duc=0 );

	int		IsDealerHandPossible ( BJHand* pDealer, int nHands );

	int	ImportFromQuery( ODBCQuery* query );

};


#endif